<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>控制台主页</title>
    {include file="include/top"}
    <style>
        .sj-flex{justify-items: center;align-items: center;}
        .sj-flex *{margin-right: 10px;display: inline-block;}
        .LAY-index-dataview div div{width: 100% !important;}
    </style>
</head>
<body>

<div class="layui-fluid">
    <div class="layui-form layui-card-header layuiadmin-card-header-auto">
        {if $ctype===0}
        {include file="include/selectsearch" ctype='layui-inline' title="供应商" classname='supplierID' optionHtml='<?php echo isset($supplier)?$supplier:"";?>' }
        {/if}
        {if $ctype==1 || $ctype===0}
        {include file="include/selectsearch" ctype='layui-inline' title="服务商" classname='serviceID' optionHtml='<?php echo isset($service)?$service:"";?>' }
        {/if}
        {if $ctype==2}
        {include file="include/selectsearch" ctype='layui-inline' title="加油站" classname='gasID' optionHtml='<?php echo isset($gas)?$gas:"";?>' }
        {/if}
        {if $ctype==0}
        {include file="include/input" class2='layui-inline' type='text' title="加油站ID" name='gasID' value=''}
        {/if}

        <div class="layui-inline">
            <label class="layui-form-label">时间段</label>
            <div class="layui-input-inline" style="width: 200px;display: flex;">
                <input type="text" name="date1" id="date1" lay-verify="date1" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
                <input type="text" name="date2" id="date2" lay-verify="date2" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-inline">
            <button class="layui-btn layuiadmin-btn-list" id="toSearch" lay-filter="LAY-app-contlist-search">
                <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
            </button>
        </div>
    </div>
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md8">
            <div class="layui-row layui-col-space15">
                {if $isAdmin==true}
                <div class="layui-col-md6">
                    <div class="layui-card">
                        <div class="layui-card-header">自营统计</div>
                        <div class="layui-card-body">

                            <div class="layui-carousel layadmin-carousel layadmin-backlog">
                                <div carousel-item>
                                    <ul class="layui-row layui-col-space10">
                                        <li class="layui-col-xs6">
                                            <a  class="layadmin-backlog-body">
                                                <h3>订单数</h3>
                                                <p><cite id="a1">66</cite></p>
                                            </a>
                                        </li>
                                        <li class="layui-col-xs6">
                                            <a  class="layadmin-backlog-body">
                                                <h3>总金额</h3>
                                                <p><cite id="a2">12</cite></p>
                                            </a>
                                        </li>
                                        <li class="layui-col-xs6">
                                            <a class="layadmin-backlog-body">
                                                <h3>优惠金额</h3>
                                                <p><cite id="a3">99</cite></p>
                                            </a>
                                        </li>
                                        <li class="layui-col-xs6">
                                            <a href="javascript:;" class="layadmin-backlog-body">
                                                <h3>结算金额</h3>
                                                <p><cite id="a4">20</cite></p>
                                            </a>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                {/if}
                <div class="layui-col-md6">
                    <div class="layui-card">
                        <div class="layui-card-header">服务商统计</div>
                        <div class="layui-card-body">

                            <div class="layui-carousel layadmin-carousel layadmin-backlog">
                                <div carousel-item>
                                    <ul class="layui-row layui-col-space10">
                                        <li class="layui-col-xs6">
                                            <a class="layadmin-backlog-body">
                                                <h3>订单数</h3>
                                                <p><cite id="a5">66</cite></p>
                                            </a>
                                        </li>
                                        <li class="layui-col-xs6">
                                            <a class="layadmin-backlog-body">
                                                <h3>总金额</h3>
                                                <p><cite id="a6">12</cite></p>
                                            </a>
                                        </li>
                                        <li class="layui-col-xs6">
                                            <a class="layadmin-backlog-body">
                                                <h3>优惠金额</h3>
                                                <p><cite id="a7">99</cite></p>
                                            </a>
                                        </li>
                                        <li class="layui-col-xs6">
                                            <a href="javascript:;" class="layadmin-backlog-body">
                                                <h3>结算金额</h3>
                                                <p><cite id="a8">20</cite></p>
                                            </a>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-col-md12">

                </div>
            </div>
        </div>

        <div class="layui-col-md4">
            <div class="layui-card">
                <div class="layui-card-header">
                    后台操作说明和注意事项
                    <i class="layui-icon layui-icon-tips" lay-tips="" lay-offset="5"></i>
                </div>
                <div class="layui-card-body layui-text layadmin-text">
                    <p>后台通知后台通知后台通知后台通知后台通知</p>
                    <p>后台通知后台通知后台通知后台通知后台通知</p>
                    <p>后台通知后台通知后台通知后台通知后台通知</p>
                    <p>后台通知后台通知后台通知后台通知后台通知</p>
                    <p>后台通知后台通知后台通知后台通知后台通知</p>
                    <p>后台通知后台通知后台通知后台通知后台通知</p>
                </div>
            </div>
        </div>

    </div>
</div>
{include file="include/js"}
<script>
    layui.config({
        base: '../../layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index','console','laydate'],function (){
        var $ = layui.$
            ,admin = layui.admin
        var laydate = layui.laydate;
        $(function (){
            getData()
        })
        $("#toSearch").click(function (){
            getData()
        })
        function getData(){
            layer.load()
            var $supplierID = $("select[name='supplier']").val()
            var $serviceID = $("select[name='service']").val()
            var $date1 = $("#date1").val()
            var $date2 = $("#date2").val()
            $.post("getHomeList", {supplierID: $supplierID,serviceID:$serviceID,date1:$date1,date2:$date2}, function (res) {
                layer.closeAll()
                if(res.code == 0){
                    for (var i in res.data){
                        var d = res.data[i]
                        $("#"+i).html(d)
                    }
                }else{
                    layer.msg(res.msg)
                }
            })
        }
        //日期
        laydate.render({
            elem: '#date1'
        });
        laydate.render({
            elem: '#date2'
        });
    });
</script>
</body>
</html>

